home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
-
- #include "parse.h"
-
- void describeprimitive(primitive *p)
- {
- char desc[200];
- char n1[50], n2[50], n3[50], n4[50], n5[50];
- char n[50];
-
- if (p->name[0])
- sprintf(n, "\"%s\"", p->name);
- else
- sprintf(n, "(%s)", p->st->symbol);
- if (p->c.p1) {
- if (p->c.p1->name[0])
- sprintf(n1, "\"%s\"", p->c.p1->name);
- else
- sprintf(n1, "(%s)", p->c.p1->st->symbol);
- }
- if (p->c.p2) {
- if (p->c.p2->name[0])
- sprintf(n2, "\"%s\"", p->c.p2->name);
- else
- sprintf(n2, "(%s)", p->c.p2->st->symbol);
- }
- if (p->c.p3) {
- if (p->c.p3->name[0])
- sprintf(n3, "\"%s\"", p->c.p3->name);
- else
- sprintf(n3, "(%s)", p->c.p3->st->symbol);
- }
- if (p->c.p4) {
- if (p->c.p4->name[0])
- sprintf(n4, "\"%s\"", p->c.p4->name);
- else
- sprintf(n4, "(%s)", p->c.p4->st->symbol);
- }
- if (p->c.p5) {
- if (p->c.p5->name[0])
- sprintf(n5, "\"%s\"", p->c.p5->name);
- else
- sprintf(n5, "(%s)", p->c.p5->st->symbol);
- }
-
- switch (p->c.type) {
- case NULLCONSTRAINT:
- break;
- case VERTFREE:
- sprintf(desc, "%s: free vertex", n);
- break;
- case VERTONLINE:
- sprintf(desc, "%s: vertex on line %s", n, n1);
- break;
- case VERTONCIRCLE:
- sprintf(desc, "%s: vertex on circle %s", n, n1);
- break;
- case VERTONCONIC:
- sprintf(desc, "%s: vertex on conic %s", n, n1);
- break;
- case VERTDISTFROMLINE:
- break;
- case VERTLINELINE:
- sprintf(desc, "%s: intersection of lines %s and %s", n, n1, n2);
- break;
- case VERTLINECIRC1:
- case VERTLINECIRC2:
- sprintf(desc, "%s: intersection of line %s and circle %s", n, n1, n2);
- break;
- case VERTLINEVERTMIRROR:
- sprintf(desc, "%s: mirror through line %s of vertex %s", n, n1, n2);
- break;
- case VERTCIRCCIRC1:
- case VERTCIRCCIRC2:
- sprintf(desc, "%s: intersection of circles %s and %s", n, n1, n2);
- break;
- case VERTCIRCCENTER:
- sprintf(desc, "%s: center of circle %s", n, n1);
- break;
- case VERTVERTVERTMID:
- sprintf(desc, "%s: midpoint of vertices %s and %s", n, n1, n2);
- break;
- case LINEVERTVERT:
- sprintf(desc, "%s: line connecting vertices %s and %s", n, n1, n2);
- break;
- case LINEVERTLINEPAR:
- sprintf(desc, "%s: line through %s parallel to %s", n, n1, n2);
- break;
- case LINEVERTLINEPERP:
- sprintf(desc, "%s: line through %s perpendicular to %s", n, n1, n2);
- break;
- case LINEVERTCIRC1:
- case LINEVERTCIRC2:
- sprintf(desc, "%s: line through %s tangent to circle %s", n, n1, n2);
- break;
- case LINELINEPERPCIRC:
- case LINELINEPARCIRC:
- break;
- case LINECIRCCIRCEXT1:
- case LINECIRCCIRCEXT2:
- sprintf(desc, "%s: exterior tangent to circles %s and %s", n, n1, n2);
- break;
- case LINECIRCCIRCINT1:
- case LINECIRCCIRCINT2:
- sprintf(desc, "%s: interior tangent to circles %s and %s", n, n1, n2);
- break;
- case CIRCVERTCIRC:
- case CIRCVERTLINE:
- case CIRCVERTVERT:
- break;
- case CIRCVERTDIST:
- break;
- case CIRCVERTVERTVERT:
- sprintf(desc, "%s: circle through vertices %s, %s and %s", n, n1, n2, n3);
- break;
- case CIRCLINELINELINE1:
- case CIRCLINELINELINE2:
- case CIRCLINELINELINE3:
- case CIRCLINELINELINE4:
- sprintf(desc, "%s: circle tangent to lines %s, %s and %s", n, n1, n2, n3);
- break;
- case CIRCCIRCCIRCCIRC:
- case CIRCVERTVERTLINE:
- case CIRCVERTVERTCIRC:
- case CIRCLINELINEVERT:
- case CIRCLINELINECIRC:
- case CIRCCIRCCIRCVERT:
- case CIRCCIRCCIRCLINE:
- case CIRCVERTLINECIRC:
- break;
- case CIRCCIRCCIRCINV:
- sprintf(desc, "%s: circle inverse of circle %s, through circle %s", n, n1, n2);
- break;
- case CIRCLINECIRCINV:
- sprintf(desc, "%s: circle inverse of line %s, through circle %s", n, n1, n2);
- break;
- case BEZVERTVERTVERTVERT:
- sprintf(desc, "%s: bezier with control vertices %s, %s, %s, and %s", n, n1, n2, n3, n4);
- case BSPVERTVERTVERTVERT:
- break;
- case RATIOVERTVERTVERT:
- case VERTVERTVERTRATIO:
- case LENVERTVERT:
- break;
- case CIRCVERTLEN:
- sprintf(desc, "%s: circle with center %s and length radius", n, n1);
- break;
- case LENPLUSLENLEN:
- case LENMINUSLENLEN:
- case ANGLEVERTVERTVERT:
- case VERTANGLEVERTVERT:
- sprintf(desc, "%s: vertex an angle offset from %s and %s", n, n1, n2);
- break;
- case ANGLEANGLETRISECT:
- case ANGLEANGLELEN:
- case ANGLEFLOAT:
- case LENFLOAT:
- case LENTIMESLENLEN:
- case LENDIVLENLEN:
- case LENANGLE:
- break;
- case CONICFIVEVERT:
- sprintf(desc, "%s: conic through verts: %s, %s, %s, %s, %s", n, n1, n2, n3, n4, n5);
- break;
- case CONICFIVELINE:
- sprintf(desc, "%s: conic through lines: %s, %s, %s, %s, %s", n, n1, n2, n3, n4, n5);
- break;
- case LINETANGENTCONIC1:
- case LINETANGENTCONIC2:
- sprintf(desc, "%s: line tangent to conic %s through %s", n, n1, n2);
- break;
- case VERTCIRCVERTINV:
- sprintf(desc, "%s: vertex %s inverted through %s", n, n1, n2);
- break;
- case VERTLINECONIC1:
- case VERTLINECONIC2:
- sprintf(desc, "%s: vertex intersection of line %s and conic %s", n, n1, n2);
- break;
- }
- displaymessage(desc);
- }
-